import logging,time

t=time.strftime('%Y%m%d-%H%M%S',time.localtime())

def get_logger(name='test_wms'):
    logger=logging.getLogger(name)

    if not logger.handlers:
        fmt=logging.Formatter('%(filename)s-%(message)s-%(levelname)s-%(asctime)s')

        file_hd=logging.FileHandler(f'WMS_{t}.log',encoding='utf-8')
        file_hd.setFormatter(fmt)
        logger.addHandler(file_hd)

        cont_hd=logging.StreamHandler()
        cont_hd.setFormatter(fmt)
        logger.addHandler(cont_hd)

        logger.setLevel(logging.INFO)

    return logger